<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            perspective: 800px;
            background-color: black;
        }
        
        .outer {
            position: relative;
            width: 200px;
            height: 200px;
            margin: 200px auto;
            transform-style: preserve-3d;
            /* transform: rotateX(45deg) rotateY(45deg); */
            animation: my 8s linear infinite;
        }
        
        .outer>div:nth-child(-n+12) {
            position: absolute;
            width: 200px;
            height: 200px;
            background-repeat: no-repeat;
            background-size: 100% 100%;
            opacity: .3;
            border-radius: 12px;
            transition: all .5;
        }
        
        .outer div:nth-child(1),
        .outer div:nth-child(7) {
            background-image: url(/漫威魔方/imgs/1.jpg);
            transform: rotateX(90deg) translateZ(100px);
        }
        
        .outer div:nth-child(2),
        .outer div:nth-child(8) {
            background-image: url(/漫威魔方/imgs/2.jpg);
            transform: rotateY(-90deg) translateZ(100px);
        }
        
        .outer div:nth-child(3),
        .outer div:nth-child(9) {
            background-image: url(/漫威魔方/imgs/3.jpg);
            transform: rotateY(90deg) translateZ(100px);
        }
        
        .outer div:nth-child(4),
        .outer div:nth-child(10) {
            background-image: url(/漫威魔方/imgs/4.jpg);
            transform: rotateX(-90deg) translateZ(100px);
        }
        
        .outer div:nth-child(5),
        .outer div:nth-child(11) {
            background-image: url(/漫威魔方/imgs/5.jpg);
            transform: rotateY(180deg) translateZ(100px);
        }
        
        .outer div:nth-child(6),
        .outer div:nth-child(12) {
            background-image: url(/漫威魔方/imgs/6.jpg);
            transform: rotateY(0deg) translateZ(100px);
        }
        
        .outer:hover div:nth-child(7) {
            transform: rotateX(450deg) translateZ(150px);
            opacity: .8;
        }
        
        .outer:hover div:nth-child(8) {
            transform: rotateY(-450deg) translateZ(150px);
            opacity: .8;
        }
        
        .outer:hover div:nth-child(9) {
            transform: rotateY(450deg) translateZ(150px);
            opacity: .8;
        }
        
        .outer:hover div:nth-child(10) {
            transform: rotateX(-450deg) translateZ(150px);
            opacity: .8;
        }
        
        .outer:hover div:nth-child(11) {
            transform: rotateY(540deg) translateZ(150px);
            opacity: .8;
        }
        
        .outer:hover div:nth-child(12) {
            transform: rotateY(360deg) translateZ(150px);
            opacity: .8;
        }
        
        .inner {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 50px;
            height: 50px;
            transform: translateX(-50%) translateY(-50%);
            transform-style: preserve-3d;
            animation: my2 2s linear infinite;
        }
        
        .inner div {
            position: absolute;
            width: 50px;
            height: 50px;
            background-repeat: no-repeat;
            background-size: 100% 100%;
            opacity: .8;
            border-radius: 12px;
        }
        
        .inner div:nth-child(1) {
            background-image: url(/漫威魔方/imgs/1.jpg);
            transform: rotateX(90deg) translateZ(30px);
        }
        
        .inner div:nth-child(2) {
            background-image: url(/漫威魔方/imgs/2.jpg);
            transform: rotateY(-90deg) translateZ(30px);
        }
        
        .inner div:nth-child(3) {
            background-image: url(/漫威魔方/imgs/3.jpg);
            transform: rotateY(90deg) translateZ(30px);
        }
        
        .inner div:nth-child(4) {
            background-image: url(/漫威魔方/imgs/4.jpg);
            transform: rotateX(-90deg) translateZ(30px);
        }
        
        .inner div:nth-child(5) {
            background-image: url(/漫威魔方/imgs/5.jpg);
            transform: rotateY(180deg) translateZ(30px);
        }
        
        .inner div:nth-child(6) {
            background-image: url(/漫威魔方/imgs/6.jpg);
            transform: rotateY(0deg) translateZ(30px);
        }
        
        @keyframes my {
            0% {
                transform: rotateX(0deg) rotateY(0deg);
            }
            100% {
                transform: rotateX(540deg) rotateY(360deg);
            }
        }
        
        @keyframes my2 {
            0% {
                transform: translateX(-50%) translateY(-50%) rotateX(0deg) rotateY(0deg);
            }
            100% {
                transform: translateX(-50%) translateY(-50%) rotateX(360deg) rotateY(720deg);
            }
        }
    </style>
</head>

<body>
    <div>
        <div class="outer">
            <div class="box1"></div>
            <div class="box2"></div>
            <div class="box3"></div>
            <div class="box4"></div>
            <div class="box5"></div>
            <div class="box6"></div>

            <div class="box7"></div>
            <div class="box8"></div>
            <div class="box9"></div>
            <div class="box10"></div>
            <div class="box11"></div>
            <div class="box12"></div>

            <div class="inner">
                <div class="box1"></div>
                <div class="box2"></div>
                <div class="box3"></div>
                <div class="box4"></div>
                <div class="box5"></div>
                <div class="box6"></div>
            </div>
        </div>



</body>

</html>